package org.codetranslators.common.optimization;

import org.codetranslators.common.ControlFlowGraph;

public class OptimizationContext {
	
	private OptimizationStrategy optimizationStrategy;
	private ControlFlowGraph controlFlowgraph;
	
	public OptimizationContext(ControlFlowGraph controlFlowgraph){
		this.controlFlowgraph = controlFlowgraph;
		setSSAMethod();
	}
	
	public void setSSAMethod(){
		optimizationStrategy = new SSA();
	}
	
	// TODO - Implement later
	public void setDataFlowAnalyses(){
		optimizationStrategy = null;
	}
	
	public ControlFlowGraph getOptimizedFlowGraph(){
		return (ControlFlowGraph)optimizationStrategy.getOptimizedFlowGraph(controlFlowgraph);
	}

}
